<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {
$Competition_Id=$_POST['Competition_Id'];
    $School_Id=$_POST['School_Id'];
  $Competition_Name=$_POST['Competition_Name'];
   $No_Of_Students=$_POST['No_Of_Students'];
    $No_Of_Teachers=$_POST['No_Of_Teachers'];
    $Result=$_POST['Result'];
   $Date=$_POST['Date'];
     $Scope=$_POST['Scope'];
   $Winner=$_POST['Winner'];

   
if($Competition_Id!=""&&$School_Id!=""&&$Competition_Name!=""&&$No_Of_Students!=""&&$No_Of_Teachers!=""&&$Result!=""&&$Date!=""&&$Scope!=""&&$Winner!="")
	{
$sql=mysql_query("INSERT INTO competition(Competition_Id,School_Id,Competition_Name,No_Of_Students,No_Of_Teachers,Result,Date,Scope,Winner)values('$Competition_Id','$School_Id','$Competition_Name','$No_Of_Students','$No_Of_Teachers','$Result','$Date','$Scope','$Winner')");
if($sql)
  {
$_SESSION['error']="This record is successfully registered!";
  }

  if(!$sql)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  }
  if($Competition_Id==""|| $School_Id==""||$Competition_Name==""||$No_Of_Students==""||$No_Of_Teachers==""||$Result==""||$Date==""||$Scope==""||$Winner=="")
	{
	$_SESSION['errorin']="Please fill all!";
  }
   }
?>
</body>
</html>
